Virtualization technologies have become widely used for sharing limited computer hardware resources. In a hardware virtualization environment, sometimes also referred to as a platform virtualization environment, one or more virtual machines can simulate a host computer with its own operating system. In particular, software executed on these virtual machines can be separated from the underlying hardware resources. As a result, virtual machines running on a same host computer can each have its own operating system. For example, a computer that is running a Microsoft Windows™ operating system may host a virtual machine that simulates a computer running a Linux operating system, based on which Linux-based software can be executed.
In a virtualization environment, desktops of multiple virtual machines can be displayed on display devices in a variety of manners. For example, screen elements of multiple virtual machines can be displayed on a same display device or can be displayed on separate display devices. A user can use one set of input devices, such as a keyboard, a mouse, and a stylus, to control multiple virtual machines, whether they are displayed on one display device or separate display devices. For example, a user can use a mouse to move a pointer generated by the mouse from one screen associated with one virtual machine to another screen associated with another virtual machine.
When a user moves a pointer from one display device to another, the virtual machines associated with the display devices need to determine the positions of the pointer. The positions of the pointer can often be determined by using absolute coordinates or relative coordinates. An absolute coordinate system can provide exact positions of the pointer; and a relative coordinate system can provide the amount of relative movement of the pointer from its previous position. In an absolute coordinate system, most input devices are not capable of obtaining information regarding the dimensions or coordinate system of the particular display device that is associated with it. As a result, the operating system of the virtual machine scales the input pointer area or coordinates to match the display-device dimensions. Such scaling can cause velocity distortion of the motion of the pointer.
In particular, in an absolute coordinate system, when the input pointer area has a different aspect ratio from that of an associated display device (e.g. a tablet screen), the operating system scales the input pointer area to match both the x-axis and y-axis of the display device. For example, a default input pointer area can have an aspect ratio of 1:1 (in width and height, the same below). When such default input pointer area relates to a display device that has an aspect ratio of 16:10 (e.g., aspect ratio of an Android Tablet screen), the operating system scales the default input pointer area to match the aspect ratio of 16:10. As a result of the scaling, the motion of the pointer along the x-axis can have a visibly different velocity (e.g., a higher speed) than that along the y-axis. Such a skewed scaling can cause difficulty for the user to use the input device. An alternative to such skewed scaling is to scale uniformly across the x-axis and the y-axis. The uniform scaling, however, can result in a reduced operating area. Therefore, Microsoft Windows™ operating system often times uses the skewed scale as a default.
While a relative coordinate system can mitigate or avoid the above described scaling difficulties associated with the absolute coordinate system, the relative coordinate system can require synchronization among multiple virtual machines to determine the positions of the pointer. As described above, multiple virtual machines can be controlled by one set of input devices on one display device or on separate display devices. Therefore, synchronization can be required if the input device is associated with several separate display devices or if the input device is associated with one display device that is shared by multiple virtual machines. Synchronization can be performed by one of the multiple virtual machines that the input device is associated with (e.g., a mouse-orchestrating virtual machine). For example, a mouse-orchestrating virtual machine can receive relative coordinates corresponding to relative mouse movement events, convert the relative coordinates to absolute coordinates, and transmit the absolute coordinates to the other virtual machines. The mouse-orchestrating virtual machine can be the virtual machine that is displayed on the particular display device on which the mouse pointer is present. The mouse-orchestrating virtual machine can also be a dedicated virtual machine for synchronization.
If the mouse-orchestrating virtual machine is the virtual machine that is displayed on the particular display device on which the mouse pointer is present, motion of the pointer can have inconsistent velocity across different virtual machines due to the differences of virtual machines. Moreover, one or more virtual machines can likely cause failure to cooperate with the other virtual machines. For example, such failure can cause the mouse to become “stuck” in one virtual machine. Further, malicious software can infect one or more of the virtual machines. For example, malicious software can utilize the interface provided by the infected virtual machine to interact with other virtual machines, therefore potentially compromising the security of other virtual machines as well.
If the mouse-orchestrating virtual machine is a dedicated virtual machine for synchronization of the pointer generated by a pointing device, the mouse-orchestrating virtual machine receives relative coordinates corresponding to the relative movements of the pointer provided by a target virtual machine (i.e., the virtual machine that is displayed on the particular display device on which the mouse pointer is present). The mouse-orchestrating virtual machine can convert the relative coordinates to absolute coordinates and transmit the absolute coordinates to the target virtual machine. The input pointer area, however, can have a different aspect ratio from that of the display device associated with the target virtual machine. As a result, converting the relative coordinates to absolute coordinates can cause the similar difficulty that the velocities across the x-axis and the y-axis are visibly different.